<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>申诉驳回</title>
    <jsp:include page="/WEB-INF/jsp/header.jsp"/>

</head>
<body>
<div class="body-main">
    <div class="main-title">
		<span class="bus-state">
			<font>申诉驳回</font>
		</span>
        <div class="title-tab">
            <a href="${basePath}/flsc/nodeOverdue/appealWaitReviewHtml.html">申诉待审核</a>
            <a href="${basePath}/flsc/nodeOverdue/appealRejectHtml.html" class="active">申诉驳回</a>
            <a href="${basePath}/flsc/nodeOverdue/appealAlreadyHtml.html" >已完成申诉</a>
        </div>
    </div>
    <div class="titleSearch">
        <div class="layui-inline">
            <label>客户：</label>
            <div class="layui-input-inline">
                <input type="text" class="input-style" placeholder="客户名称/电话" maxlength="200"
                       id="customerNameOrPhone"
                       name="customerNameOrPhone">
            </div>
        </div>
        <div class="layui-inline">
            <label>生产订单编号：</label>
            <div class="layui-input-inline">
                <input type="text" class="input-style" placeholder="生产订单编号" maxlength="200"
                       id="productOrderNo"
                       name="productOrderNo">
            </div>
        </div>
        <%--<div class="layui-inline">--%>
            <%--<label>办理业务：</label>--%>
            <%--<div class="layui-input-inline">--%>
                <%--<select name="appealBusinessCode" class="select-style" flsc-select-content="businessProductId">--%>
                <%--</select>--%>
            <%--</div>--%>
        <%--</div>--%>
        <div class="layui-inline">
            <label>申诉节点：</label>
            <div class="layui-input-inline">
                <input type="text" class="input-style" placeholder="模糊查询" maxlength="200"
                       id="nodeName1"
                       name="nodeName1">
            </div>
        </div>
        <div class="layui-inline">
            <label>申请人：</label>
            <div class="layui-input-inline">
                <input type="text" class="input-style" placeholder="模糊查询" maxlength="200"
                       id="flowUserName"
                       name="flowUserName">
            </div>
        </div>
        <div class="layui-inline">
            <label>审核人：</label>
            <div class="layui-input-inline">
                <input type="text" class="input-style" placeholder="模糊查询" maxlength="200"
                       id="reviewerName"
                       name="reviewerName">
            </div>
        </div>
        <div class="layui-inline">
            <label>申诉时间：</label>
            <div class="layui-input-inline">
                <input type="text" name="startTime" placeholder="开始日期" class="Wdate input-style" id="d4311"
                       onFocus="var d4312=$dp.$('d4312'); WdatePicker({onpicked:function(){d4312.focus();}, maxDate:'#F{ $dp.$D(\'d4312\')}', dateFmt:'yyyy-MM-dd'})">
            </div>
            <span>~</span>
            <div class="layui-input-inline">
                <input type="text" name="endTime" placeholder="结束日期" class="Wdate input-style" id="d4312"
                       onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d4311\')}', dateFmt:'yyyy-MM-dd'})">
            </div>
        </div>
        <div class="layui-inline">
            <button type="button" class="layui-btn layui-btn-mini layui-btn-normal"
                    onclick="dataTableReload()">搜索
            </button>
            <button type="button" class="layui-btn layui-btn-mini layui-btn-primary"
                    onclick="cleanSearch()">
                清空
            </button>
            <button class="layui-btn layui-btn-mini layui-btn-green" onclick="exportExcel('/flsc/nodeOverdue/exportAppealRejectExcel.do')">导出</button>
        </div>
    </div>
    <div class="table-conter">

    </div>
    <div class="dataTables_wrapper no-footer">
        <!--表格 start-->
        <table id="table" class="cell-border crm-table columnsHidden">
            <thead>
            <tr>
                <th width="50">序号</th>
                <th>生产订单编号</th>
                <th>订单编号</th>
                <th>工单编号</th>
                <th>合同编号</th>
                <th>客户</th>
                <th>申诉业务</th>
                <th>申诉节点</th>
                <th> 扣罚金额</th>
                <th>扣罚分数</th>
                <th>生产事业部</th>
                <th>申诉人</th>
                <th>申诉原因</th>
                <th>申请时间</th>
                <th>审核人</th>
                <th>驳回原因</th>
                <%--<th>操作</th>--%>
            </tr>
            </thead>
            <tbody>

            </tbody>
        </table>
        <!--表格 end-->
    </div>
    <%--保存当前登录用户--%>
    <input id="userId" type="hidden" value=${user.id}  >
</div>
<jsp:include page="/WEB-INF/jsp/footer.jsp"/>
<script type="text/javascript"
        src="${basePath}/static/js/common/choose.extend.js?v=${version}"></script>
<script type="text/javascript" src="${basePath}/static/js/zzsc/production/sc_common.js?v=${version}"></script>
<script type="text/javascript" src="${basePath}/static/js/overdue_deduction.js?v=${version}"></script>
<script type="text/javascript" charset="utf-8">


    //页面加载完毕，查询数据
    var table = null;
    $(document).ready(function () {
        table = $('#table').dataTableExtend({
            "ajax": {"url": "${basePath}/flsc/nodeOverdue/appealReject.do", "type": "get"},
            "fnServerParams": function (aoData) {
                aoData = $.extend(aoData, {}, $('.titleSearch').serializeJson());
                console.log(aoData);
            },
            "scrollX": true,
            "fixedColumns": {//页面左侧固定5列，右侧1列
                "leftColumns": 3,
                "rightColumns": 1
            },
            "pageLength": 10,
            "aoColumns": [
                {
                    "orderable": false,
                    "render": function (data, type, full, meta) {
                        return meta.row + 1;
                    }
                }, {
                    "orderable": false,
                    "data": "scProductOrderNo",
                    "render": function (data, type, full, meta) {
                       // return  data ?  '<a href="javascript:;"  class="layui-table-link" onclick="openOrderInfoDetail(\'' + full.scProductOrderNo + '\',\'' + full.scProductOrderId + '\')" />' + data + '</a>':'- ';
                        return data ? data : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "orderNo",
                    "render": function (data, type, full, meta) {
                       // return  data ?  '<a href="javascript:;"  class="layui-table-link" onclick="openBusinessDetail(\'' + full.orderNo + '\',\'' + full.orderId + '\')" /><p>' + data + '</p></a>': '-';
                        return data ? data : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "workOrderNo",
                    "render": function (data, type, full, meta) {
                        return data ?  data  : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "contractNo",
                    "render": function (data, type, full, meta) {
                        return data ? data  : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "customerName",
                    "render": function (data, type, full, meta) {
                        if(full.customerPhone) {
                            return data ? '<p class="line2" title="' + data + '&#10;' + full.customerPhone + '">' + data + "</br>" + full.customerPhone + '</p>' : '-';
                        }else{
                            return data ? '<p class="line2" title="' + data + '&#10;">' + data+ '</p>' : '-';
                        }
                    }
                }, {
                    "orderable": false,
                    "data": "appealBusinessName",
                    "render": function (data, type, full, meta) {
                        return data ?  data  : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "nodeName",
                    "render": function (data, type, full, meta) {
                        return  data?  data  : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "oldMoney",
                    "render": function (data, type, full, meta) {
                        return   null != data ?  data : '-';
                    }
                },{
                    "orderable": false,
                    "data": "oldPoint",
                    "render": function (data, type, full, meta) {
                        return   null != data ?  data  : '-';
                    }
                },{
                    "orderable": false,
                    "data": "productOrgName",
                    "render": function (data, type, full, meta) {
                        return data ?  data : '-';
                    }
                },
                {
                    "orderable": false,
                    "data": "flowUserName",
                    "render": function (data, type, full, meta) {
                        return data ?  data : '-';
                    }
                },{
                    "orderable": false,
                    "data": "appealReason",
                    "render": function (data, type, full, meta) {
                        return data ? '<p class="line2" style="min-width: 100px" title="'+data+'">' + data + '</p>' : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "createTime",
                    "render": function (data, type, full, meta) {
                        return data ?  data  : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "reviewerName",
                    "render": function (data, type, full, meta) {
                        return data ?  data  : '-';
                    }
                }, {
                    "orderable": false,
                    "data": "overruleReason",
                    "render": function (data, type, full, meta) {
                        return data ? '<p class="line2" style="min-width: 100px" title="'+data+'">' + data + '</p>' : '-';
                    }
                }
                // ,{
                //     "orderable": false,
                //     "data": "id",
                //     "render": function (data, type, full, meta) {
                //         // var result = "<div class='iboss-table-opt'>";
                //         // //当前登录用户是申诉人
                //         // if ($("#userId").val() == full.flowUserId) {
                //         //     result += '<a href=\'javascript:void(0)\' class="iboss-link"  onclick="withdrawAppeal(\''+full.timeoutPunishId+'\',\''+full.id+'\')" />撤回</a>';
                //         //     result += '<a href=\'javascript:void(0)\' class="iboss-link"  onclick="continueAppeal(\''+full.timeoutPunishId+'\',\''+full.id+'\')" />继续申请</a>';
                //         // }
                //         // result += "</div>";
                //         // return result;
                //         return "";
                //     }
                // }
                ],
            "columnDefs": []
        });

    });


    //刷新表格
    function dataTableReload2() {
        $('#table').dataTableExtend("reloadFalse");
    }

    function dataTableReload() {
        table.ajax.reload();
    }
    /**
     * 导出到excel
     */
    function exportExcel(url) {
        var data = $('.titleSearch').serializeJson();
        //判断参数是否为空
        if(Object.keys(data).length ==0){
            DGG.Layer.message("必须选择搜索条件才能进行导出", {icon: '1'});
            return false;
        }
        export_table(url, data);
    }

</script>
</body>
</html>